package com.soft.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.soft.entity.Emp;
import com.soft.service.EmpService;
@RestController
@RequestMapping("/emp")
public class EmpController {
	@Autowired
	private EmpService empService;
	@RequestMapping("/queryByDeptName")
	public List<Emp>queryByDeptName(String deptName){
		return empService.queryByDeptName(deptName);
	}
	@RequestMapping("/updateEmp")
	public String updateEmp(String empname,String position,String deptName)
	{
		int num = empService.updateEmpTest(empname, position, deptName);
		if(num == 1)
		{
			return "更新成功";
		}
		else
		{
			return "更新失败";
		}
	}
}
